<template>
	<view>
		<u-list v-if="data.length >0 ">
			<u-list-item v-for="(item,index) in data" :key="item.id">
				<u-cell :isLink="true" @click="handle(item)">
					<view class="u-slot-title circle-item" slot="title">
						<view class="circle-index">
							<text>{{ index + 1 }}</text>
						</view>
						<text class="u-cell-text">{{ item.activityName }}</text>
					</view>
				</u-cell>
			</u-list-item>
		</u-list>
		<u-cell-group v-else>
			<u-cell title="暂无记录" :isLink="false" :border="false">
			</u-cell>
		</u-cell-group>
	</view>
</template>

<script>
	export default {
		name: "ActivityList",
		props: {
			data: {
				type: Array
			}
		},
		data() {
			return {}
		},
		methods: {
			handle(item) {
				this.$emit("handleClick", item)
			}
		},
		onLoad() {}
	}
</script>

<style lang="scss" scoped>
	.circle-item {
		display: flex;
		align-items: center;

		.circle-index {
			width: 32px;
			height: 32px;
			border-radius: 50%;
			background-color: #3288DF;
			color: #ffffff;
			display: flex;
			justify-content: center;
			align-items: center;
			margin-right: 8px;
		}
	}
</style>